// src/api/raw.ts   一个新的文件
import axios from 'axios'
import { useAuthStore } from '@/stores/auth'

export const raw = axios.create({
  baseURL: '/api',
  timeout: 10000
})

// 只加 token，不做 res.data 剥离
raw.interceptors.request.use(config => {
  const auth = useAuthStore()
  if (auth.token) {
    config.headers.Authorization = `Bearer ${auth.token}`
  }
  return config
})